import request from '@/utils/request'

export default {
  // 分页条件查询模块列表
  getList(query) {
    return request({
      url: `/article/pri/category/search`,
      method: 'post',
      data: {
        ...query
      }
    })
  },
  // 添加模块
  add(data) {
    return request({
      url: `/article/pri/category`,
      method: 'post',
      data: data
    })
  },

  // 根据id查询模块
  getById(id) {
    return request({
      url: `/article/pri/category/${id}`,
      method: 'get'
    })
  },

  // 更新
  update(data) {
    return request({
      url: `/article/pri/category`,
      method: 'put',
      data
    })
  },

  // 删除
  deleteById(id) {
    return request({
      url: `/article/pri/category/${id}`,
      method: 'delete'
    })
  },

  // 查询正常状态的分类
  getNormalList() {
    return request({
      url: `/article/pri/category/list`,
      method: 'post'
    })
  },

  // 获取所有正常状态下的分类和标签
  getCategoryAndLabel() {
    return request({
      url: `/article/pri/category/all`,
      method: 'get'
    })
  }
}

